Feature: Book Genie Mode - Automated Testing with Detailed Reporting
File name: BookGenie.feature
Relative path: features/BookGenie.feature
Scenario Outline: Book Genie Response Validation with Citation Verification
Error: No book data extracted from BookGenie response.
at CustomWorld.(anonymous) (/home/runner/work/HC_Epub_Automation/HC_Epub_Automation/tests/steps/bookGenie.step.ts:46:15)
at /home/runner/work/HC_Epub_Automation/HC_Epub_Automation/tests/steps/bookGenie.step.ts:8:71
at __awaiter (/home/runner/work/HC_Epub_Automation/HC_Epub_Automation/tests/steps/bookGenie.step.ts:4:12)
at CustomWorld.(anonymous) (/home/runner/work/HC_Epub_Automation/HC_Epub_Automation/tests/steps/bookGenie.step.ts:59:12)
=== SCENARIO LOGS: Book Genie Response Validation with Citation Verification === [6:14:01 PM] Navigating to Creative Workspace login page [6:14:03 PM] Homepage visibility: false [6:14:03 PM] ℹ️ Typing query: "Suggest 5 books on christmas" [6:14:03 PM] ℹ️ Preparing to type query: "Suggest 5 books on christmas" [6:14:03 PM] ℹ️ Waiting for chat input to be visible [6:14:04 PM] ℹ️ Clearing chat input [6:14:05 PM] ℹ️ Typing query: "Suggest 5 books on christmas" [6:14:06 PM] ℹ️ Pressing Enter to submit query [6:14:06 PM] ✅ Query submitted successfully: "Suggest 5 books on christmas" [6:14:06 PM] ℹ️ Waiting for AI to complete thinking... [6:14:06 PM] 📋 WAITING FOR AI RESPONSE [6:14:06 PM] ℹ️ Looking for AI thinking indicator... [6:14:06 PM] ℹ️ Waiting for thinking indicator to appear (max 2 minutes) [6:14:08 PM] ✅ ✓ AI thinking indicator appeared - AI is processing the request [6:14:08 PM] ℹ️ Waiting for thinking indicator to disappear (max 5 minutes) [6:14:09 PM] ✅ ✓ AI thinking completed - Response should be ready [6:14:09 PM] ℹ️ 🔍 Checking for "None of the above" option... [6:14:09 PM] ℹ️ ✓ "None of the above" option not present - proceeding normally [6:14:09 PM] ℹ️ Allowing additional time for response rendering [6:14:12 PM] ✅ AI response wait process completed [6:14:12 PM] ℹ️ Validating response for query: "Suggest 5 books on christmas" [6:14:12 PM] 📋 VALIDATING RESPONSE FOR QUERY: "Suggest 5 books on christmas" [6:14:12 PM] ℹ️ Locating the latest response in chat [6:14:12 PM] ℹ️ Waiting for response to be visible (max 30 seconds) [6:14:13 PM] ✅ Response received - Length: 636 characters [6:14:13 PM] ℹ️ Response preview: Watch Me WorkInterpreting context for your query...That sounds like a lovely theme! To help you find... [6:14:13 PM] ℹ️ Extracting book data from response... [6:14:13 PM] 📋 EXTRACTING BOOK DATA FROM RESPONSE [6:14:13 PM] ℹ️ Locating BookGenie response container [6:14:13 PM] ℹ️ Extracting HTML content from response [6:14:13 PM] ℹ️ HTML content extracted - Length: 9176 characters [6:14:13 PM] ℹ️ Parsing HTML to extract book data [6:14:13 PM] ✅ SUCCESSFULLY EXTRACTED 0 BOOKS [6:14:13 PM] 📋 EXTRACTED BOOKS SUMMARY [6:14:13 PM] 📊 Total books extracted: 0 [6:14:13 PM] 📊 Average relevance score: 0% [6:14:13 PM] ✅ Extracted 0 books from response === END LOGS ===
Scenario Logs: Book Genie Response Validation with Citation Verification
Scenario Outline: Book Genie Response Validation with Citation Verification
CITATION VALIDATION DETAILED REPORT ================================================================================ BOOK: Henry Huggins ------------------------------------------------------------ ✅ Reason 1: PASS (100%) ✅ Reason 2: PASS (95%) ✅ Reason 3: PASS (100%) BOOK: Anne of Green Gables ------------------------------------------------------------ ✅ Reason 1: PASS (100%) ✅ Reason 2: PASS (100%) ✅ Reason 3: PASS (95%) BOOK: The Secret Garden ------------------------------------------------------------ ✅ Reason 1: PASS (95%) ❌ Reason 2: FAIL (0%) 📝 Reason: It features an orphaned girl who discovers a secret garden and brings it back to life... 📚 Citation: Then, Mary discovers a secret garden, surrounded by walls and locked with a missing key. One day, wi... ⚠️ Citation text not found in reason: "Then, Mary discovers a secret garden, surrounded by walls and locked with a missing key. One day, with the help of two unexpected companions, she discovers a way in. Is everything in the garden dead, or can Mary bring it back to life?" ✅ Reason 3: PASS (100%) SUMMARY: 8/9 reasons passed (88.9%) OVERALL STATUS: PASS
Citation Validation Summary: 8/9 passed
📊 Citation Validation Report
Generated on 10/18/2025, 6:16:06 PM
📖 Henry Huggins
📖 Anne of Green Gables
📖 The Secret Garden
📈 Validation Summary
PER-BOOK AI VALIDATION REPORT - Query: "Suggest 3 books for childrens"
================================================================================
OVERALL RELEVANCE SCORE: 70%
STATUS: FAIL
BOOKS ANALYZED: 3
BOOK 1: "Henry Huggins"
------------------------------------------------------------
Overall Score: 70%
SECTION SCORES:
Author Information: 70% - Analysis unavailable - API error
Publishing Date: 70% - Analysis unavailable - API error
Why Match Explanations: 70% - Analysis unavailable - API error
Relevance Scores: 70% - Analysis unavailable - API error
DETAILED FEEDBACK:
• AI analysis temporarily unavailable due to service overload
IMPROVEMENT SUGGESTIONS:
• Retry analysis when service is available
================================================================================
BOOK 2: "Anne of Green Gables"
------------------------------------------------------------
Overall Score: 70%
SECTION SCORES:
Author Information: 70% - Analysis unavailable - API error
Publishing Date: 70% - Analysis unavailable - API error
Why Match Explanations: 70% - Analysis unavailable - API error
Relevance Scores: 70% - Analysis unavailable - API error
DETAILED FEEDBACK:
• AI analysis temporarily unavailable due to service overload
IMPROVEMENT SUGGESTIONS:
• Retry analysis when service is available
================================================================================
BOOK 3: "The Secret Garden"
------------------------------------------------------------
Overall Score: 70%
SECTION SCORES:
Author Information: 70% - Analysis unavailable - API error
Publishing Date: 70% - Analysis unavailable - API error
Why Match Explanations: 70% - Analysis unavailable - API error
Relevance Scores: 70% - Analysis unavailable - API error
DETAILED FEEDBACK:
• AI analysis temporarily unavailable due to service overload
IMPROVEMENT SUGGESTIONS:
• Retry analysis when service is available
================================================================================
SUMMARY FEEDBACK:
----------------------------------------
• AI analysis service is temporarily overloaded
• Using fallback analysis with neutral scores
• Error: [GoogleGenerativeAI Error]: Error fetching from https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-pro:generateContent: [429 Too Many Requests] You exceeded your current quota, please check your plan and billing details. For more information on this error, head to: https://ai.google.dev/gemini-api/docs/rate-limits.
* Quota exceeded for metric: generativelanguage.googleapis.com/generate_content_free_tier_requests, limit: 2
Please retry in 46.558146551s. [{"@type":"type.googleapis.com/google.rpc.QuotaFailure","violations":[{"quotaMetric":"generativelanguage.googleapis.com/generate_content_free_tier_requests","quotaId":"GenerateRequestsPerMinutePerProjectPerModel-FreeTier","quotaDimensions":{"location":"global","model":"gemini-2.5-pro"},"quotaValue":"2"}]},{"@type":"type.googleapis.com/google.rpc.Help","links":[{"description":"Learn more about Gemini API quotas","url":"https://ai.google.dev/gemini-api/docs/rate-limits"}]},{"@type":"type.googleapis.com/google.rpc.RetryInfo","retryDelay":"46s"}]
OVERALL IMPROVEMENT SUGGESTIONS:
----------------------------------------
• Retry the analysis when Gemini API is less busy
• Consider running tests during off-peak hours
• Check Google AI status page for service updates
🤖 PER-BOOK AI Response Relevance Validation
Query: "Suggest 3 books for childrens"
Overall Relevance Score: 70%
Status: FAIL
Books Analyzed: 3
Individual Book Analyses
📖 Book 1: "Henry Huggins" - 70%
Author Information: 70%
Analysis unavailable - API error
Publishing Date: 70%
Analysis unavailable - API error
Why Match Explanations: 70%
Analysis unavailable - API error
Relevance Scores: 70%
Analysis unavailable - API error
Improvement Suggestions:
📖 Book 2: "Anne of Green Gables" - 70%
Author Information: 70%
Analysis unavailable - API error
Publishing Date: 70%
Analysis unavailable - API error
Why Match Explanations: 70%
Analysis unavailable - API error
Relevance Scores: 70%
Analysis unavailable - API error
Improvement Suggestions:
📖 Book 3: "The Secret Garden" - 70%
Author Information: 70%
Analysis unavailable - API error
Publishing Date: 70%
Analysis unavailable - API error
Why Match Explanations: 70%
Analysis unavailable - API error
Relevance Scores: 70%
Analysis unavailable - API error
Improvement Suggestions:
Summary Feedback
• AI analysis service is temporarily overloaded
• Using fallback analysis with neutral scores
• Error: [GoogleGenerativeAI Error]: Error fetching from https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-pro:generateContent: [429 Too Many Requests] You exceeded your current quota, please check your plan and billing details. For more information on this error, head to: https://ai.google.dev/gemini-api/docs/rate-limits. * Quota exceeded for metric: generativelanguage.googleapis.com/generate_content_free_tier_requests, limit: 2 Please retry in 46.558146551s. [{"@type":"type.googleapis.com/google.rpc.QuotaFailure","violations":[{"quotaMetric":"generativelanguage.googleapis.com/generate_content_free_tier_requests","quotaId":"GenerateRequestsPerMinutePerProjectPerModel-FreeTier","quotaDimensions":{"location":"global","model":"gemini-2.5-pro"},"quotaValue":"2"}]},{"@type":"type.googleapis.com/google.rpc.Help","links":[{"description":"Learn more about Gemini API quotas","url":"https://ai.google.dev/gemini-api/docs/rate-limits"}]},{"@type":"type.googleapis.com/google.rpc.RetryInfo","retryDelay":"46s"}]
Overall Improvement Suggestions
=== SCENARIO LOGS: Book Genie Response Validation with Citation Verification ===
[6:14:14 PM] Navigating to Creative Workspace login page
[6:14:17 PM] Homepage visibility: false
[6:14:17 PM] ℹ️ Typing query: "Suggest 3 books for childrens"
[6:14:17 PM] ℹ️ Preparing to type query: "Suggest 3 books for childrens"
[6:14:17 PM] ℹ️ Waiting for chat input to be visible
[6:14:18 PM] ℹ️ Clearing chat input
[6:14:18 PM] ℹ️ Typing query: "Suggest 3 books for childrens"
[6:14:19 PM] ℹ️ Pressing Enter to submit query
[6:14:19 PM] ✅ Query submitted successfully: "Suggest 3 books for childrens"
[6:14:19 PM] ℹ️ Waiting for AI to complete thinking...
[6:14:19 PM] 📋 WAITING FOR AI RESPONSE
[6:14:19 PM] ℹ️ Looking for AI thinking indicator...
[6:14:19 PM] ℹ️ Waiting for thinking indicator to appear (max 2 minutes)
[6:14:21 PM] ✅ ✓ AI thinking indicator appeared - AI is processing the request
[6:14:21 PM] ℹ️ Waiting for thinking indicator to disappear (max 5 minutes)
[6:14:29 PM] ✅ ✓ AI thinking completed - Response should be ready
[6:14:29 PM] ℹ️ 🔍 Checking for "None of the above" option...
[6:14:29 PM] ℹ️ ✓ "None of the above" option not present - proceeding normally
[6:14:29 PM] ℹ️ Allowing additional time for response rendering
[6:14:32 PM] ✅ AI response wait process completed
[6:14:32 PM] ℹ️ Validating response for query: "Suggest 3 books for childrens"
[6:14:32 PM] 📋 VALIDATING RESPONSE FOR QUERY: "Suggest 3 books for childrens"
[6:14:32 PM] ℹ️ Locating the latest response in chat
[6:14:32 PM] ℹ️ Waiting for response to be visible (max 30 seconds)
[6:14:32 PM] ✅ Response received - Length: 2030 characters
[6:14:32 PM] ℹ️ Response preview: Watch Me WorkInterpreting context for your query...Retrieving Relevant Books for 'books suitable for...
[6:14:32 PM] ℹ️ Extracting book data from response...
[6:14:32 PM] 📋 EXTRACTING BOOK DATA FROM RESPONSE
[6:14:32 PM] ℹ️ Locating BookGenie response container
[6:14:32 PM] ℹ️ Extracting HTML content from response
[6:14:32 PM] ℹ️ HTML content extracted - Length: 25302 characters
[6:14:32 PM] ℹ️ Parsing HTML to extract book data
[6:14:32 PM] ✅ SUCCESSFULLY EXTRACTED 3 BOOKS
[6:14:32 PM] 📋 EXTRACTED BOOKS SUMMARY
[6:14:32 PM] 📚 1. "Henry Huggins" - Score: 100%%
[6:14:32 PM] 📚 2. "Anne of Green Gables" - Score: 100%%
[6:14:32 PM] 📚 3. "The Secret Garden" - Score: 100%%
[6:14:32 PM] 📊 Total books extracted: 3
[6:14:32 PM] 📊 Average relevance score: 100%
[6:14:32 PM] ✅ Extracted 3 books from response
[6:14:32 PM] ℹ️ Saving 3 books to Excel file: test_results/suggest_3_books_for_childrens.xlsx
[6:14:32 PM] 📋 SAVING BOOKS TO EXCEL FILE
[6:14:32 PM] ℹ️ Target file path: test_results/suggest_3_books_for_childrens.xlsx
[6:14:32 PM] ℹ️ Exporting 3 books to Excel format
[6:14:32 PM] ✅ Book data saved to: test_results/suggest_3_books_for_childrens.xlsx
[6:14:32 PM] 📊 File verified - Size: 16.87 KB
[6:14:32 PM] ✅ ✓ Excel file creation verified successfully
[6:14:32 PM] 📋 STARTING INDIVIDUAL BOOK VALIDATION (3 books) for query: "Suggest 3 books for childrens"
[6:14:32 PM] 📋 📚 VALIDATING BOOK 1: "Henry Huggins"
[6:14:32 PM] ℹ️ Starting comprehensive book validation
[6:14:32 PM] ℹ️ Validating title: "Henry Huggins" vs expected: "Henry Huggins"
[6:14:32 PM] ✅ ✅ TITLE VALIDATION PASSED: "Henry Huggins"
[6:14:32 PM] ℹ️ Validating score: 100% vs expected: 100%
[6:14:32 PM] ✅ ✅ SCORE VALIDATION PASSED: 100% (expected 100%)
[6:14:32 PM] ✅ ✅ PERFECT SCORE GAP VALIDATION: Book has 100% score and no gap mentioned
[6:14:32 PM] ℹ️ Why-match points: extracted 3 vs expected 3
[6:14:32 PM] ✅ ✅ WHY-MATCH VALIDATION PASSED: 3 points (expected 3)
[6:14:32 PM] ✅ 🎉 BOOK 1 VALIDATION: ALL CHECKS PASSED!
[6:14:32 PM] ℹ️ Book 1 validation completed
[6:14:32 PM] 📋 📚 VALIDATING BOOK 2: "Anne of Green Gables"
[6:14:32 PM] ℹ️ Starting comprehensive book validation
[6:14:32 PM] ℹ️ Validating title: "Anne of Green Gables" vs expected: "Anne of Green Gables"
[6:14:32 PM] ✅ ✅ TITLE VALIDATION PASSED: "Anne of Green Gables"
[6:14:32 PM] ℹ️ Validating score: 100% vs expected: 100%
[6:14:32 PM] ✅ ✅ SCORE VALIDATION PASSED: 100% (expected 100%)
[6:14:32 PM] ✅ ✅ PERFECT SCORE GAP VALIDATION: Book has 100% score and no gap mentioned
[6:14:32 PM] ℹ️ Why-match points: extracted 3 vs expected 3
[6:14:32 PM] ✅ ✅ WHY-MATCH VALIDATION PASSED: 3 points (expected 3)
[6:14:32 PM] ✅ 🎉 BOOK 2 VALIDATION: ALL CHECKS PASSED!
[6:14:32 PM] ℹ️ Book 2 validation completed
[6:14:32 PM] 📋 📚 VALIDATING BOOK 3: "The Secret Garden"
[6:14:32 PM] ℹ️ Starting comprehensive book validation
[6:14:32 PM] ℹ️ Validating title: "The Secret Garden" vs expected: "The Secret Garden"
[6:14:32 PM] ✅ ✅ TITLE VALIDATION PASSED: "The Secret Garden"
[6:14:32 PM] ℹ️ Validating score: 100% vs expected: 100%
[6:14:32 PM] ✅ ✅ SCORE VALIDATION PASSED: 100% (expected 100%)
[6:14:32 PM] ✅ ✅ PERFECT SCORE GAP VALIDATION: Book has 100% score and no gap mentioned
[6:14:32 PM] ℹ️ Why-match points: extracted 3 vs expected 3
[6:14:32 PM] ✅ ✅ WHY-MATCH VALIDATION PASSED: 3 points (expected 3)
[6:14:32 PM] ✅ 🎉 BOOK 3 VALIDATION: ALL CHECKS PASSED!
[6:14:32 PM] ℹ️ Book 3 validation completed
[6:14:32 PM] 📊 VALIDATION SUMMARY: 3/3 books passed
[6:14:32 PM] ✅ ALL BOOKS VALIDATED SUCCESSFULLY!
[6:14:32 PM] 📋 🔍 VALIDATING REASON-CITATION MATCHES
[6:14:32 PM] ℹ️ Starting citation validation process...
[6:14:32 PM] 📋 🚀 STARTING COMPLETE CITATION VALIDATION WORKFLOW
[6:14:32 PM] ℹ️ Step 1: Extracting books from AI response
[6:14:32 PM] 📋 EXTRACTING BOOK DATA FROM RESPONSE
[6:14:32 PM] ℹ️ Locating BookGenie response container
[6:14:32 PM] ℹ️ Extracting HTML content from response
[6:14:32 PM] ℹ️ HTML content extracted - Length: 25302 characters
[6:14:32 PM] ℹ️ Parsing HTML to extract book data
[6:14:32 PM] ✅ SUCCESSFULLY EXTRACTED 3 BOOKS
[6:14:32 PM] 📋 EXTRACTED BOOKS SUMMARY
[6:14:32 PM] 📚 1. "Henry Huggins" - Score: 100%%
[6:14:32 PM] 📚 2. "Anne of Green Gables" - Score: 100%%
[6:14:32 PM] 📚 3. "The Secret Garden" - Score: 100%%
[6:14:32 PM] 📊 Total books extracted: 3
[6:14:32 PM] 📊 Average relevance score: 100%
[6:14:32 PM] ℹ️ Step 2: Extracting citation texts from book elements
[6:14:32 PM] 📋 📚 EXTRACTING CITATION TEXTS FROM BOOK ELEMENTS
[6:14:32 PM] ℹ️ Step 1: Waiting for main book section
[6:14:33 PM] ℹ️ Found 7 total accordion sections
[6:14:33 PM] ℹ️ Found individual book: "1. Henry Huggins"
[6:14:33 PM] ℹ️ Found individual book: "2. Anne of Green Gables"
[6:14:33 PM] ℹ️ Found individual book: "3. The Secret Garden"
[6:14:33 PM] ℹ️ Processing 3 individual book sections
[6:14:33 PM] 📋 📖 PROCESSING BOOK 1: "Henry Huggins"
[6:14:33 PM] ℹ️ Expanding book section: "Henry Huggins"
[6:14:36 PM] ✅ Book section expanded: "Henry Huggins"
[6:14:36 PM] ℹ️ Expanding "Why this book is the match" section for: "Henry Huggins"
[6:14:39 PM] ✅ "Why this book is the match" section expanded for: "Henry Huggins"
[6:14:39 PM] ℹ️ Found 3 citation buttons for "Henry Huggins"
[6:14:39 PM] ℹ️ Extracting citation 1/3 for "Henry Huggins"
[6:14:39 PM] ℹ️ Processing metadata citation 1 for "Henry Huggins"
[6:14:40 PM] ℹ️ Clicking to OPEN metadata citation 1
[6:14:42 PM] ℹ️ Extracted citation text (first 100 chars): classic...
[6:14:42 PM] ℹ️ Clicking to CLOSE metadata citation 1
[6:14:43 PM] ✅ ✅ metadata citation 1 closed successfully
[6:14:43 PM] ℹ️ ✅ Citation 1 extracted successfully (length: 7)
[6:14:43 PM] ℹ️ Extracting citation 2/3 for "Henry Huggins"
[6:14:43 PM] ℹ️ Processing metadata citation 2 for "Henry Huggins"
[6:14:44 PM] ℹ️ Clicking to OPEN metadata citation 2
[6:14:46 PM] ℹ️ Extracted citation text (first 100 chars): Just as Henry Huggins is complaining that nothing exciting ever happens, a friendly dog sits down be...
[6:14:46 PM] ℹ️ Clicking to CLOSE metadata citation 2
[6:14:48 PM] ✅ ✅ metadata citation 2 closed successfully
[6:14:48 PM] ℹ️ ✅ Citation 2 extracted successfully (length: 390)
[6:14:48 PM] ℹ️ Extracting citation 3/3 for "Henry Huggins"
[6:14:48 PM] ℹ️ Processing metadata citation 3 for "Henry Huggins"
[6:14:49 PM] ℹ️ Clicking to OPEN metadata citation 3
[6:14:51 PM] ℹ️ Extracted citation text (first 100 chars): JUVENILE FICTION...
[6:14:51 PM] ℹ️ Clicking to CLOSE metadata citation 3
[6:14:52 PM] ✅ ✅ metadata citation 3 closed successfully
[6:14:53 PM] ℹ️ ✅ Citation 3 extracted successfully (length: 16)
[6:14:53 PM] ℹ️ Collapsing book section: "Henry Huggins"
[6:14:54 PM] ✅ Book section collapsed: "Henry Huggins"
[6:14:54 PM] ✅ ✅ Completed processing "Henry Huggins" - 3 citations extracted
[6:14:54 PM] 📋 📖 PROCESSING BOOK 2: "Anne of Green Gables"
[6:14:54 PM] ℹ️ Expanding book section: "Anne of Green Gables"
[6:14:57 PM] ✅ Book section expanded: "Anne of Green Gables"
[6:14:57 PM] ℹ️ Expanding "Why this book is the match" section for: "Anne of Green Gables"
[6:15:00 PM] ✅ "Why this book is the match" section expanded for: "Anne of Green Gables"
[6:15:00 PM] ℹ️ Found 3 citation buttons for "Anne of Green Gables"
[6:15:00 PM] ℹ️ Extracting citation 1/3 for "Anne of Green Gables"
[6:15:00 PM] ℹ️ Processing metadata citation 1 for "Anne of Green Gables"
[6:15:01 PM] ℹ️ Clicking to OPEN metadata citation 1
[6:15:03 PM] ℹ️ Extracted citation text (first 100 chars): classic...
[6:15:03 PM] ℹ️ Clicking to CLOSE metadata citation 1
[6:15:05 PM] ✅ ✅ metadata citation 1 closed successfully
[6:15:05 PM] ℹ️ ✅ Citation 1 extracted successfully (length: 7)
[6:15:05 PM] ℹ️ Extracting citation 2/3 for "Anne of Green Gables"
[6:15:05 PM] ℹ️ Processing metadata citation 2 for "Anne of Green Gables"
[6:15:06 PM] ℹ️ Clicking to OPEN metadata citation 2
[6:15:08 PM] ℹ️ Extracted citation text (first 100 chars): a talkative eleven-year-old orphan with a heart full of dreams and a desperate longing for a home....
[6:15:08 PM] ℹ️ Clicking to CLOSE metadata citation 2
[6:15:09 PM] ✅ ✅ metadata citation 2 closed successfully
[6:15:09 PM] ℹ️ ✅ Citation 2 extracted successfully (length: 98)
[6:15:09 PM] ℹ️ Extracting citation 3/3 for "Anne of Green Gables"
[6:15:09 PM] ℹ️ Processing metadata citation 3 for "Anne of Green Gables"
[6:15:10 PM] ℹ️ Clicking to OPEN metadata citation 3
[6:15:13 PM] ℹ️ Extracted citation text (first 100 chars): JUVENILE FICTION: Classics...
[6:15:13 PM] ℹ️ Clicking to CLOSE metadata citation 3
[6:15:14 PM] ✅ ✅ metadata citation 3 closed successfully
[6:15:14 PM] ℹ️ ✅ Citation 3 extracted successfully (length: 26)
[6:15:14 PM] ℹ️ Collapsing book section: "Anne of Green Gables"
[6:15:16 PM] ✅ Book section collapsed: "Anne of Green Gables"
[6:15:16 PM] ✅ ✅ Completed processing "Anne of Green Gables" - 3 citations extracted
[6:15:16 PM] 📋 📖 PROCESSING BOOK 3: "The Secret Garden"
[6:15:16 PM] ℹ️ Expanding book section: "The Secret Garden"
[6:15:19 PM] ✅ Book section expanded: "The Secret Garden"
[6:15:19 PM] ℹ️ Expanding "Why this book is the match" section for: "The Secret Garden"
[6:15:22 PM] ✅ "Why this book is the match" section expanded for: "The Secret Garden"
[6:15:22 PM] ℹ️ Found 3 citation buttons for "The Secret Garden"
[6:15:22 PM] ℹ️ Extracting citation 1/3 for "The Secret Garden"
[6:15:22 PM] ℹ️ Processing metadata citation 1 for "The Secret Garden"
[6:15:23 PM] ℹ️ Clicking to OPEN metadata citation 1
[6:15:25 PM] ℹ️ Extracted citation text (first 100 chars): classic literature...
[6:15:25 PM] ℹ️ Clicking to CLOSE metadata citation 1
[6:15:26 PM] ✅ ✅ metadata citation 1 closed successfully
[6:15:26 PM] ℹ️ ✅ Citation 1 extracted successfully (length: 18)
[6:15:26 PM] ℹ️ Extracting citation 2/3 for "The Secret Garden"
[6:15:26 PM] ℹ️ Processing metadata citation 2 for "The Secret Garden"
[6:15:27 PM] ℹ️ Clicking to OPEN metadata citation 2
[6:15:29 PM] ℹ️ Extracted citation text (first 100 chars): Then, Mary discovers a secret garden, surrounded by walls and locked with a missing key. One day, wi...
[6:15:29 PM] ℹ️ Clicking to CLOSE metadata citation 2
[6:15:31 PM] ✅ ✅ metadata citation 2 closed successfully
[6:15:31 PM] ℹ️ ✅ Citation 2 extracted successfully (length: 234)
[6:15:31 PM] ℹ️ Extracting citation 3/3 for "The Secret Garden"
[6:15:31 PM] ℹ️ Processing metadata citation 3 for "The Secret Garden"
[6:15:32 PM] ℹ️ Clicking to OPEN metadata citation 3
[6:15:34 PM] ℹ️ Extracted citation text (first 100 chars): JUVENILE FICTION...
[6:15:34 PM] ℹ️ Clicking to CLOSE metadata citation 3
[6:15:36 PM] ✅ ✅ metadata citation 3 closed successfully
[6:15:36 PM] ℹ️ ✅ Citation 3 extracted successfully (length: 16)
[6:15:36 PM] ℹ️ Collapsing book section: "The Secret Garden"
[6:15:37 PM] ✅ Book section collapsed: "The Secret Garden"
[6:15:37 PM] ✅ ✅ Completed processing "The Secret Garden" - 3 citations extracted
[6:15:37 PM] ✅ 🎉 Successfully extracted citations from 3 books
[6:15:37 PM] ℹ️ Step 3: Validating reason-citation matches
[6:15:37 PM] 📋 🔍 VALIDATING REASON-CITATION MATCHES (80% THRESHOLD)
[6:15:37 PM] ℹ️ 📖 Validating 3 reasons for: "Henry Huggins"
[6:15:37 PM] ℹ️ Reason 1: Checking match...
[6:15:37 PM] ✅ ✅ "Henry Huggins" - Reason 1: 100% match - PASS
[6:15:37 PM] ℹ️ Reason 2: Checking match...
[6:15:46 PM] ✅ ✅ "Henry Huggins" - Reason 2: 95% match - PASS
[6:15:46 PM] ℹ️ Reason 3: Checking match...
[6:15:46 PM] ✅ ✅ "Henry Huggins" - Reason 3: 100% match - PASS
[6:15:46 PM] ℹ️ 📖 Validating 3 reasons for: "Anne of Green Gables"
[6:15:46 PM] ℹ️ Reason 1: Checking match...
[6:15:46 PM] ✅ ✅ "Anne of Green Gables" - Reason 1: 100% match - PASS
[6:15:46 PM] ℹ️ Reason 2: Checking match...
[6:15:46 PM] ✅ ✅ "Anne of Green Gables" - Reason 2: 100% match - PASS
[6:15:46 PM] ℹ️ Reason 3: Checking match...
[6:15:57 PM] ✅ ✅ "Anne of Green Gables" - Reason 3: 95% match - PASS
[6:15:57 PM] ℹ️ 📖 Validating 3 reasons for: "The Secret Garden"
[6:15:57 PM] ℹ️ Reason 1: Checking match...
[6:16:06 PM] ✅ ✅ "The Secret Garden" - Reason 1: 95% match - PASS
[6:16:06 PM] ℹ️ Reason 2: Checking match...
[6:16:06 PM] ❌ ❌ "The Secret Garden" - Reason 2: 0% match - FAIL
[6:16:06 PM] ❌ ⚠️ Citation text not found in reason: "Then, Mary discovers a secret garden, surrounded by walls and locked with a missing key. One day, with the help of two unexpected companions, she discovers a way in. Is everything in the garden dead, or can Mary bring it back to life?"
[6:16:06 PM] ℹ️ Reason 3: Checking match...
[6:16:06 PM] ✅ ✅ "The Secret Garden" - Reason 3: 100% match - PASS
[6:16:06 PM] 📊 📊 CITATION VALIDATION SUMMARY: 8/9 passed (88.9%)
[6:16:06 PM] ✅ 🎉 REASON-CITATION VALIDATION: OVERALL PASSED
[6:16:06 PM] ℹ️ Step 4: Generating detailed report
[6:16:06 PM] 📋 📋 GENERATING CITATION VALIDATION REPORT
[6:16:06 PM] ℹ️ Report generated: 8/9 reasons passed
[6:16:06 PM] ✅ ✅ Citation validation workflow completed successfully
[6:16:06 PM] 📊 📈 OVERALL CITATION VALIDATION: 8/9 (88.9%)
[6:16:06 PM] ✅ ✅ REASON-CITATION VALIDATION: OVERALL PASSED
[6:16:06 PM] 📋 📋 GENERATING DETAILED CITATION VALIDATION REPORT
[6:16:06 PM] ℹ️ Generating HTML citation validation report
[6:16:06 PM] ✅ Generated HTML report for 9 reasons
[6:16:06 PM] ✅ ✅ Citation validation HTML report generated and attached
[6:16:06 PM] ✅ ✅ Citation validation plain text report attached
[6:16:06 PM] ℹ️ Checking database connectivity...
[6:16:06 PM] ✅ ✅ Database connected successfully
[6:16:06 PM] ℹ️ Database path: /home/runner/work/HC_Epub_Automation/HC_Epub_Automation/tests/test_data/database.xlsx
[6:16:06 PM] ℹ️ Total books: 10032
[6:16:06 PM] 📊 Database contains 10032 books
[6:16:06 PM] ✅ ✅ Database book count requirement met: 10032 >= 10032
[6:16:06 PM] 📋 🔍 VALIDATING EXTRACTED BOOKS INDIVIDUALLY AGAINST DATABASE
[6:16:06 PM] ℹ️ Checking book 1/3: "Henry Huggins"
[6:16:06 PM] ℹ️ Checking if book exists in database: "Henry Huggins"
[6:16:06 PM] ✅ ✅ Database match: "Henry Huggins" → "Henry Huggins 4-Book Collection"
[6:16:06 PM] ℹ️ Checking book 2/3: "Anne of Green Gables"
[6:16:06 PM] ℹ️ Checking if book exists in database: "Anne of Green Gables"
[6:16:07 PM] ✅ ✅ Database match: "Anne of Green Gables" → "Anne of Green Gables"
[6:16:07 PM] ℹ️ Checking book 3/3: "The Secret Garden"
[6:16:07 PM] ℹ️ Checking if book exists in database: "The Secret Garden"
[6:16:07 PM] ✅ ✅ Database match: "The Secret Garden" → "The Secret Garden"
[6:16:07 PM] 📊 INDIVIDUAL DATABASE VALIDATION SUMMARY: 3/3 books found in database
[6:16:07 PM] ✅ 🎉 ALL BOOKS VALIDATED SUCCESSFULLY AGAINST DATABASE!
[6:16:07 PM] 📋 🤖 VALIDATING RESPONSE RELEVANCE WITH GEMINI AI - PER BOOK ANALYSIS
[6:16:07 PM] ℹ️ Starting Gemini AI per-book relevance validation...
[6:16:07 PM] 📋 🤖 ANALYZING RESPONSE RELEVANCE WITH GEMINI AI - PER BOOK ANALYSIS
[6:16:07 PM] ℹ️ Starting Gemini AI analysis with retry logic...
[6:16:13 PM] ⚠ ⚠️ GEMINI VALIDATION: Using fallback analysis due to API issues
[6:16:13 PM] ℹ️ Overall Score: 70% (Fallback)
[6:16:13 PM] 📋 📖 ANALYSIS FOR: "Henry Huggins" - Score: 70%
[6:16:13 PM] ℹ️ ❌ Author Information: 70% - Analysis unavailable - API error
[6:16:13 PM] ℹ️ ❌ Publishing Date: 70% - Analysis unavailable - API error
[6:16:13 PM] ℹ️ ❌ Why Match Explanations: 70% - Analysis unavailable - API error
[6:16:13 PM] ℹ️ ❌ Relevance Scores: 70% - Analysis unavailable - API error
[6:16:13 PM] ℹ️ 💡 Book-specific improvements:
[6:16:13 PM] ℹ️ - Retry analysis when service is available
[6:16:13 PM] 📋 📖 ANALYSIS FOR: "Anne of Green Gables" - Score: 70%
[6:16:13 PM] ℹ️ ❌ Author Information: 70% - Analysis unavailable - API error
[6:16:13 PM] ℹ️ ❌ Publishing Date: 70% - Analysis unavailable - API error
[6:16:13 PM] ℹ️ ❌ Why Match Explanations: 70% - Analysis unavailable - API error
[6:16:13 PM] ℹ️ ❌ Relevance Scores: 70% - Analysis unavailable - API error
[6:16:13 PM] ℹ️ 💡 Book-specific improvements:
[6:16:13 PM] ℹ️ - Retry analysis when service is available
[6:16:13 PM] 📋 📖 ANALYSIS FOR: "The Secret Garden" - Score: 70%
[6:16:13 PM] ℹ️ ❌ Author Information: 70% - Analysis unavailable - API error
[6:16:13 PM] ℹ️ ❌ Publishing Date: 70% - Analysis unavailable - API error
[6:16:13 PM] ℹ️ ❌ Why Match Explanations: 70% - Analysis unavailable - API error
[6:16:13 PM] ℹ️ ❌ Relevance Scores: 70% - Analysis unavailable - API error
[6:16:13 PM] ℹ️ 💡 Book-specific improvements:
[6:16:13 PM] ℹ️ - Retry analysis when service is available
[6:16:13 PM] ℹ️ 📊 SUMMARY FEEDBACK:
[6:16:13 PM] ℹ️ • AI analysis service is temporarily overloaded
[6:16:13 PM] ℹ️ • Using fallback analysis with neutral scores
[6:16:13 PM] ℹ️ • Error: [GoogleGenerativeAI Error]: Error fetching from https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-pro:generateContent: [429 Too Many Requests] You exceeded your current quota, please check your plan and billing details. For more information on this error, head to: https://ai.google.dev/gemini-api/docs/rate-limits.
* Quota exceeded for metric: generativelanguage.googleapis.com/generate_content_free_tier_requests, limit: 2
Please retry in 46.558146551s. [{"@type":"type.googleapis.com/google.rpc.QuotaFailure","violations":[{"quotaMetric":"generativelanguage.googleapis.com/generate_content_free_tier_requests","quotaId":"GenerateRequestsPerMinutePerProjectPerModel-FreeTier","quotaDimensions":{"location":"global","model":"gemini-2.5-pro"},"quotaValue":"2"}]},{"@type":"type.googleapis.com/google.rpc.Help","links":[{"description":"Learn more about Gemini API quotas","url":"https://ai.google.dev/gemini-api/docs/rate-limits"}]},{"@type":"type.googleapis.com/google.rpc.RetryInfo","retryDelay":"46s"}]
[6:16:13 PM] ❌ ❌ GEMINI AI VALIDATION FAILED: 70% relevance score (required: 80%)
[6:16:13 PM] ℹ️ Continuing execution due to soft assertion...
=== END LOGS ===